#include "Rect.h"

#include <QtGui>

#include <math.h>

int main(int argc, char **argv)
{
	QApplication app(argc, argv);
	qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));

	QGraphicsScene scene;
	scene.setSceneRect(0, 0, 600, 600);

	scene.setItemIndexMethod(QGraphicsScene::NoIndex);

	Rect *rect = new Rect;
	scene.addItem(rect);

	QGraphicsView view(&scene);
	view.setRenderHint(QPainter::Antialiasing);
	view.setBackgroundBrush(QColor(250,250,0));

	view.setCacheMode(QGraphicsView::CacheBackground);
	view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
	view.setDragMode(QGraphicsView::ScrollHandDrag);

	view.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Shooting Rect"));

	view.resize(605, 605);
	view.show();

	QTimer timer;
	QObject::connect(&timer, SIGNAL(timeout()), &scene, SLOT(advance()));
	timer.start(1000 / 33);

	return app.exec();
}

